package cn.ssm.biz.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

import cn.ssm.biz.UserroleBiz;
import cn.ssm.dao.UserroleMapper;
import cn.ssm.pojo.User;
import cn.ssm.pojo.Userrole;

@Service("userroleBiz")
public class UserroleBizimpl implements UserroleBiz {
	
	@Autowired
	@Qualifier("userroleMapper")
	private UserroleMapper userroleMapper;

	@Override
	public int AddUserRole(Userrole ur) {
		// TODO Auto-generated method stub
		return userroleMapper.InsertUserRole(ur);
	}

	@Override
	public User selectUsersTopId() {
		int  count =	userroleMapper.selectUsersCount()-1;
		return userroleMapper.selectUsersTopId(count);
	}
	

	@Override
	public int UpdateRole(int upUId, int upRoleId) {
		// TODO Auto-generated method stub
		return userroleMapper.UpdateRole(upUId, upRoleId);
	}
	@Override
	public Userrole findUserRoleByid(int id) {
		// TODO Auto-generated method stub
		return userroleMapper.selectUserRoleByid(id);
	}
}
